# 安装request
# pip install requests

import requests

query = input("请输入搜索内容")
url = f'https://www.baidu.com/s?wd={query}'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0'
}

response = requests.get(url, headers=headers)

print(response)
print(response.text)
response.close()